
public class Box<T> {

    private T t;          

    public void add(T t) {
        this.t = t;
    }

    public T get() {
        return t;
    }

     public <U extends Animal> void inspect(U u){
        System.out.println("T: " + t.getClass().getName());
        System.out.println("U: " + u.getClass().getName());
    }
    
     public static void main(String[] args) {
        Box<Number> integerBox = new Box<>();
        integerBox.add(new Integer(5));
        integerBox.add(new Double("4.6"));
        integerBox.add(new Float(5.4));
        integerBox.inspect(new Rottweiler());
    }
}
